<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>动态改变文档内容</title>
    <script>
        function changeTitle() {
            document.querySelector('h1').textContent = "欢迎来到我的网站";
            document.getElementById('currentTime').textContent = new Date().toLocaleString();
        }
    </script>
</head>
<body>
<h1>初始标题</h1>
<button id="changeTitle" onclick="changeTitle()">改变标题</button>
<div id="currentTime"></div>
</body>
</html>
